
export enum DiagnosticFlag {
    error,
    warning,
    suggestion,
    message
}

export interface Diagnostic {
    flag: DiagnosticFlag;
    code: number;
    start: number;
    length: number;
    message: string;
}

export interface DiagnosticMessage {
    flag: DiagnosticFlag;
    key: string;
    code: number;
    template: string;
    _diagnosicMessageBrand: any;
}

export function createErrorDiagnosticMessage(key: string, code: number, template: string): DiagnosticMessage {
    return { flag: DiagnosticFlag.error, key, code, template, _diagnosicMessageBrand: undefined };
}

export function createWarningDiagnosticMessage(key: string, code: number, template: string): DiagnosticMessage {
    return { flag: DiagnosticFlag.warning, key, code, template, _diagnosicMessageBrand: undefined };
}

export const errorMessages = {
    // SyntaxError
    syntaxError:                                    createErrorDiagnosticMessage("SyntaxError"                                  , 1001, "'{0}'处语法错误."),
    invalidToken:                                   createErrorDiagnosticMessage("InvalidToken"                                 , 1002, "无效字符."),
    unexpectedLineFeed:                             createErrorDiagnosticMessage("UnexpectedLineFeed"                           , 1003, "行意外结束."),
    requireLineFeed:                                createErrorDiagnosticMessage("RequireLineFeed"                              , 1004, "需要换行."),
    lostKeyword:                                    createErrorDiagnosticMessage("LostKeyword"                                  , 1005, "缺少'{0}'"),
    invalidCharactor:                               createErrorDiagnosticMessage("InvalidCharator"                              , 1006, "无效字符'{0}'."),
    unexpectedToken:                                createErrorDiagnosticMessage("UnexpectedToken"                              , 1007, "应为'{0}'."),
    unterminatedStringLiteral:                      createErrorDiagnosticMessage("UnterminatedStringLiteral"                    , 1008, "字符串没有终结."),
    lostStringLiteralLineFeed:                      createErrorDiagnosticMessage("LostStringLiteralLineFeed"                    , 1009, "字符串缺少换行符."),
    unterminatedMultiLineStringLiteral:             createErrorDiagnosticMessage("UnterminatedMultiLineStringLiteral"           , 1010, "多行字符串必须要以'!\"'结尾."),
    invalidHexNumberLiteral:                        createErrorDiagnosticMessage("InvalidHexNumberLiteral"                      , 1011, "'{0}'是无效的16进制数字."),
    invalidOctNumberLiteral:                        createErrorDiagnosticMessage("InvalidOctNumberLiteral"                      , 1012, "'{0}'是无效的8进制数字."),
    unexpectedAmpersand:                            createErrorDiagnosticMessage("UnexpectedAmpersand"                          , 1013, "'&'后只能是'o'、'O'、'h'或'H'."),
    invalidIdentifierName:                          createErrorDiagnosticMessage("InvalidIdentifiername"                        , 1014, "'{0}'不是有效的变量或函数命名."),
    keywordCannotBeIdentifier:                      createErrorDiagnosticMessage("KeywordCannotBeIdentifier"                    , 1015, "'{0}'是保留字,不能用于命名."),
    tokenCanOnlyUseInPPContext:                     createErrorDiagnosticMessage("TokenCanOnlyUseInPPContext"                   , 1016, "'{0}'只能用在预处理器上下文中."),
    tokenCanOnlyUseInMetadataContext:               createErrorDiagnosticMessage("TokenCanOnlyUseInMetadataContext"             , 1017, "'{0}'只能用在元数据上下文中."),
    invalidMemberExpressionObject:                  createErrorDiagnosticMessage("InvalidMemberExpressionObject"                , 1018, "'{0}'是无效的成员表达式对象."),
    invalidMemberExpressionProperty:                createErrorDiagnosticMessage("InvalidMember"                                , 1019, "'{0}'是无效的成员表达式属性."),
    lostMemberExpressionProperty:                   createErrorDiagnosticMessage("LostMemberExpressionProperty"                 , 1020, "成员表达式缺少属性."),
    invalidObjectCollectionIteratorCategoies:       createErrorDiagnosticMessage("InvalidCategories"                            , 1021, "'{0}'是无效的迭代器类型集合."),
    invalidExpression:                              createErrorDiagnosticMessage("InvalidExpression"                            , 1022, "无效的表达式."),
    invalidExpressionLineFeed:                      createErrorDiagnosticMessage("InvalidExpressionLineFeed"                    , 1023, "无效的表达式换行符."),
    lostExpressionLineFeed:                         createErrorDiagnosticMessage("LostExpressionLineFeed"                       , 1024, "缺少表达式换行符."),
    lostLocalDeclaration:                           createErrorDiagnosticMessage("LostLocalDeclaration"                         , 1025, "缺少变量定义."),
    invalidExpressionElement:                       createErrorDiagnosticMessage("InvalidExpressionElement"                     , 1026, "'{0}'是无效的表达式元素."),
    lostMemberExpressionObject:                     createErrorDiagnosticMessage("LostMemberExpressionObject"                   , 1027, "缺少成员表达式对象."),
    keywordCanOnlyUseInDeclareFile:                 createErrorDiagnosticMessage("KeywordCanOnlyUseInDeclareFile"               , 1028, "'{0}'关键字只能在声明文件(.d.mrs)中使用."),
    bindingTypeCanOnlyUseInDeclareFile:             createErrorDiagnosticMessage("BindingTypeCanOnlyUseInDelcareFile"           , 1029, "类型绑定只能在声明文件(.d.mrs)中使用."),
    invalidArrayDeclarationDimension:               createErrorDiagnosticMessage("InvalidArrayDeclarationDimension"             , 1030, "无效的数组维度定义."),
    onlyLastArrayDimensionsCanBeDynamic:            createErrorDiagnosticMessage("OnlyLastArrayDimensionsCanBeDynamic"          , 1031, "无效的数组维度定义, 数组只有最后一个维度可以是动态的."),
    invalidDeclaration:                             createErrorDiagnosticMessage("InvalidDeclaration"                           , 1032, "无效的变量声明."),
    invalidGroupExpression:                         createErrorDiagnosticMessage("InvalidGroupExpression"                       , 1033, "无效的集合表达式."),
    invalidAssignmentExpression:                    createErrorDiagnosticMessage("InvalidAssignmentExpression"                  , 1034, "无效的赋值表达式."),
    invalidCategoricalItem:                         createErrorDiagnosticMessage("InvalidCategoricalItem"                       , 1035, "无效的Categorical元素."),
    invalidSelectCaseTestExpression:                createErrorDiagnosticMessage("InvalidSelectCaseTestExpression"              , 1036, "无效的Select条件表达式."),
    invalidSectionLabel:                            createErrorDiagnosticMessage("InvalidSectionLabel"                          , 1037, "无效的Section描述."),
    invalidSection:                                 createErrorDiagnosticMessage("InvalidSection"                               , 1038, "无效的DMS文件Event Section."),
    sectionRedeclare:                               createErrorDiagnosticMessage("SectionRedeclare"                             , 1039, "名为'{0}'的Section已存在."),
    invalidModifier:                                createErrorDiagnosticMessage("InvalidModifier"                              , 1040, "无效的修饰符."),
    invalidInterfaceName:                           createErrorDiagnosticMessage("InvalidInterfaceName"                         , 1041, "无效的接口名."),
    eventSectionCanOnlyUseInDmsFile:                createErrorDiagnosticMessage("EventSectionCanOnlyUseInDmsFile"              , 1042, "Event只能在dms文件中使用."),
    invalidEventSectionName:                        createErrorDiagnosticMessage("InvalidEventSectionName"                      , 1043, "无效的Event名."),
    invalidMacroName:                               createErrorDiagnosticMessage("InvalidMacroName"                             , 1044, "无效的宏名."),
    invalidPreprocessorParameter:                   createErrorDiagnosticMessage("InvalidPreprocessorParameter"                 , 1045, "无效的预处理器参数."),
    invalidLocation:                                createErrorDiagnosticMessage("InvalidLocation"                              , 1046, "无效的跳转位置."),
    invalidExitPrecedure:                           createErrorDiagnosticMessage("InvalidExitPrecedure"                         , 1047, "'{0}'不是可以跳出的语句."),
    wrongExitPrecedure:                             createErrorDiagnosticMessage("WrongExitPrecedure"                           , 1048, "当前语句不在'{0}'语句块中."),
    defaultMemberMustBeProperty:                    createErrorDiagnosticMessage("DefaultMemberMustBeProperty"                  , 1049, "默认成员必须是属性."),
    constantInitializationMustBeLiteral:            createErrorDiagnosticMessage("ConstantInitializationMustBeLiteral"          , 1050, "常量必须使用常量初始化."),
    lostNecessarySectionMember:                     createErrorDiagnosticMessage("LostNecessarySectionMember"                   , 1051, "缺少必需的Section成员'{0}'."),
    unexpectedComma:                                createErrorDiagnosticMessage("UnexpectedComma"                              , 1052, "多余的逗号."),
    illInclude:                                     createErrorDiagnosticMessage("IllInclude"                                   , 1053, "此处的文件包含是有问题的."),
    subroutineShouldHaveNoReturnValue:              createErrorDiagnosticMessage("SubroutineShouldHaveNoReturnValue"            , 1054, "函数'Sub'式声明不能有返回值, 需要改用'Function'式声明."),
    unaryExpressionNeedReturnValue:                 createErrorDiagnosticMessage("UnaryExpressionNeedReturnValue"               , 1055, "一元表达式需要返回值."),
    inputDataSourceIsNotDeclared:                   createErrorDiagnosticMessage("InputDataSourceIsNotDeclared"                 , 1056, "名为'{0}'的数据源 (InputDataSource) 未声明."),
    functionCannotDeclareInSection:                 createErrorDiagnosticMessage("FunctionCannotDeclareInSection"               , 1057, "Section内不允许声明函数."),
    // preprocessor
    stringizerTypeError:                            createErrorDiagnosticMessage("StringizerTypeError"                          , 1081, "字符串化运算符参数错误: 无法接受字符串."),
    tokenPasterResultError:                         createErrorDiagnosticMessage("TokenPasterResultError"                       , 1082, "标记粘贴运算符结果错误: '{0}'不是有效的标识符."),
    parameterMacroVarargsMustPlaceAtLast:           createErrorDiagnosticMessage("ParameterMacroVarargsMustPlaceAtLast"         , 1083, "参数宏的可变参数必须位于末尾."),
    unexpectedNumberOfParameterMacroArguments:      createErrorDiagnosticMessage("UnexpectedNumberOfParameterMacroArguments"    , 1084, "参数宏'{0}'定义了'{1}'个参数, 但是此处接收了'{2}'个."),
    lostParenOfParameterMacro:                      createErrorDiagnosticMessage("LostParenOfParameterMacro"                    , 1085, "'{0}'是参数宏, 此处缺少'()'"),
    // 语义错误
    optionIncorrect:                                createErrorDiagnosticMessage("OptionIncorrect"                              , 2001, "Option后只能是'implicit | explicit | globalvariables'"),
    paramArrayCanOnlyModifyArrayParameter:          createErrorDiagnosticMessage("ParamArrayCanOnlyModifyArrayParameter"        , 2002, "'ParamArray'只能用于修饰数组类型的参数."),
    paramArrayParameterMustAtLast:                  createErrorDiagnosticMessage("ParamArrayParameterMustAtLast"                , 2003, "'ParamArray'修饰的参数必须放在最后."),
    parameterCannotPlaceBehindOptionalParameter:    createErrorDiagnosticMessage("ParameterCannotPlaceBehindOptionalParameter"  , 2004, "非可选参数不能位于可选参数之后."),
    multidimensionalArrayCannotbeImplicitDeclared:  createErrorDiagnosticMessage("MultidimensionalArrayCannotbeImplicitDeclared", 2005, "多维数组无法隐式声明."),
    invalidIndexType:                               createErrorDiagnosticMessage("InvalidIndexType"                             , 2006, "没有登记类型为'{0}'的索引."),
    invalidObjectIterator:                          createErrorDiagnosticMessage("InvalidObjectIterator"                        , 2007, "无效的对象迭代器."),
    cannotAssignBetweenDifferentType:               createErrorDiagnosticMessage("CannotAssignBetweenDifferentType"             , 2008, "类型'{0}'的值不能赋值给类型为'{1}'的变量"),
    intrinsicTypeDonnotAllowInherit:                createErrorDiagnosticMessage("IntrinsicTypeDonnotAllowInherit"              , 2009, "基础类型'{0}'不允许继承."),
    invalidInheritOrImplementType:                  createErrorDiagnosticMessage("InvalidInheritOrImplementType"                , 2010, "无效的类型."),
    implementOrInheritTypeMustBeInterface:          createErrorDiagnosticMessage("ImplementOrInheritTypeMustBeInterface"        , 2010, "必须是接口类型."),
    classCanOnlyInheritOneBaseClass:                createErrorDiagnosticMessage("ClassCanOnlyInheritOneBaseClass"              , 2011, "只能有一个基类."),
    classImplementsMustBeClass:                     createErrorDiagnosticMessage("ClassImplementsMustBeClass"                   , 2012, "必须是类."),
    interfaceInheritsDuplication:                   createErrorDiagnosticMessage("InterfaceInheritsDuplication"                 , 2013, "接口继承重复."),
    classImplementsDuplication:                     createErrorDiagnosticMessage("ClassImplementsDuplication"                   , 2014, "接口实现重复."),
    typeIsModule:                                   createErrorDiagnosticMessage("TypeIsModule"                                 , 2015, "'{0}'是模块."),
    expectNumberOfArguments:                        createErrorDiagnosticMessage("ExpectNumberOfArguments"                      , 2016, "'{0}'定义了'{1}'个参数, 但是此处接收了'{2}'个."),
    parameterIsNotOptional:                         createErrorDiagnosticMessage("ParameterIsNotOptional"                       , 2017, "未提供参数'{0}'."),
    assignmentLeftIsReadonly:                       createErrorDiagnosticMessage("AssignmentLeftIsReadonly"                     , 2018, "'{0}'是只读的."),
    assignmentRightIsWriteonly:                     createErrorDiagnosticMessage("AssignmentRightIsWriteonly"                   , 2019, "'{0}'是只写的."),
    indexRankError:                                 createErrorDiagnosticMessage("IndexRankError"                               , 2020, "用于访问'{0}'的维度数错误."),
    objectCollectionIteratorCannotPlaceRightHand:   createErrorDiagnosticMessage("ObjectCollectionIteratorCannotPlaceRightHand" , 2021, "对象迭代器 (..) 不允许被用作赋值."),
    categoricalIndexLengthDoNotEqualOne:            createErrorDiagnosticMessage("CategoricalIndexLengthDoNotEqualOne"          , 2022, "分类类型值用作索引时长度必须为1."),
    conditionNeedReturnValue:                       createErrorDiagnosticMessage("ConditionNeedReturnValue"                     , 2023, "条件测试语句需要返回值."),

    declarationTypeConflict:                        createErrorDiagnosticMessage("DeclarationTypeConflict"                      , 3001, "'{0}'已被定义, 类型为'{1}'."),
    variableReDeclaration:                          createErrorDiagnosticMessage("VariableReDeclaration"                        , 3002, "变量'{0}'被重定义."),
    variableIsNotDeclared:                          createErrorDiagnosticMessage("VariableIsNotDeclared"                        , 3003, "变量'{0}'未定义."),
    macroIsNotDeclared:                             createErrorDiagnosticMessage("MacroIsNotDeclared"                           , 3004, "宏'{0}'未定义."),
    functionIsNotDeclared:                          createErrorDiagnosticMessage("FunctionIsNotDeclared"                        , 3005, "函数'{0}'未定义."),
    typeRedeclaration:                              createErrorDiagnosticMessage("TypeRedeclaration"                            , 3006, "类型'{0}'已存在."),
    typeIsNotExist:                                 createErrorDiagnosticMessage("TypeIsNotExist"                               , 3007, "未找到名为'{0}'的类型签名."),
    typeIsNotExistInModule:                         createErrorDiagnosticMessage("TypeIsNotExistInModule"                       , 3008, "在模块'{0}'中不存在名为'{1}'的类型签名."),
    locationIsNotExist:                             createErrorDiagnosticMessage("LocationIsNotExist"                           , 3009, "未找到名为'{0}'的行标签."),
    locationRedeclaration:                          createErrorDiagnosticMessage("LocationRedeclaration"                        , 3010, "名为'{0}'的行标签已存在."),
    enumMemberRedeclaration:                        createErrorDiagnosticMessage("EnumMemberRedecaration"                       , 3011, "名为'{0}'的枚举成员已经存在."),
    classMemberRedelcaration:                       createErrorDiagnosticMessage("ClassMemberRedeclaration"                     , 3012, "名为'{0}'的类成员已存在."),
    interfaceMemberRedeclaration:                   createErrorDiagnosticMessage("InterfaceMemberRedeclaration"                 , 3013, "名为'{0}'的接口成员已存在."),
    parameterRedeclaration:                         createErrorDiagnosticMessage("ParameterRedeclaration"                       , 3014, "参数'{0}'已存在."),
    functionRedeclaration:                          createErrorDiagnosticMessage("FunctionRedeclaration"                        , 3015, "函数'{0}'已存在."),
    propertyRedeclaration:                          createErrorDiagnosticMessage("PropertyRedeclaration"                        , 3016, "属性'{0}'已存在."),
    moduleMemberRedeclaration:                      createErrorDiagnosticMessage("ModuleMemberRedeclaration"                    , 3017, "名为'{0}'的模块成员已存在."),
    symbolIsNotAFunction:                           createErrorDiagnosticMessage("SymbolIsNotAFunction"                         , 3018, "符号'{0}'不是函数."),
    interfaceCannotImplements:                      createErrorDiagnosticMessage("InterfaceCannotImplements"                    , 3019, "接口不允许实现接口."),
    interfaceMemberConflict:                        createErrorDiagnosticMessage("InterfaceMemberConflict"                      , 3020, "接口成员'{0}'和'{1}'中已存在."),
    classImplementsMemberLost:                      createErrorDiagnosticMessage("ClassImplementsMemberLost"                    , 3021, "缺少接口'{0}'成员'{1}'的实现."),
    classInheritMemberConflict:                     createErrorDiagnosticMessage("ClassInheritMemberConflict"                   , 3022, "类成员'{0}'和基类'{1}'中的成员冲突."),
    classImplementsMemberWithSubstandard:           createErrorDiagnosticMessage("ClassImplementsMemberWithSubstandard"         , 3023, "类成员'{0}'实现不符合接口'{1}'的定义."),
    inheritMemberIsNotCompatible:                   createErrorDiagnosticMessage("InheritMemberIsNotCompatible"                 , 3024, "扩展接口成员'{0}'和基础接口定义不兼容."),
    interfaceOrClassMeMustBeProperty:               createErrorDiagnosticMessage("InterfaceOrClassMeMustBeProperty"             , 3025, "接口或类的'Me'成员必须是属性."),
    interfaceOrClassMePropertyRequireOneParameter:  createErrorDiagnosticMessage("InterfaceOrClassMePropertyRequireOneParameter", 3026, "接口或类的'Me'属性需要1个参数."),
    interfaceOrClassMePropertyTypeError:            createErrorDiagnosticMessage("InterfaceOrClassMePropertyTypeError"          , 3027, "接口或类的'Me'属性参数必须是'Long'或'Any'."),

    // metadata
    invalidMetadataPropertyValue:                   createErrorDiagnosticMessage("InvalidMetadataPropertyValue"                 , 4001, "无效的元数据属性值."),
    invalidMetadataTemplateValue:                   createErrorDiagnosticMessage("InvalidMetadataTemplateValue"                 , 4002, "无效的元数据模板值."),
    duplicateMetadataTemplateName:                  createErrorDiagnosticMessage("DuplicateMetadataTemplateName"                , 4003, "名为'{0}'的元数据模板属性已存在."),
    invalidMetadataCellStyleProperty:               createErrorDiagnosticMessage("InvalidMetadataCellStyleProperty"             , 4004, "'{0}'是无效的单元格样式属性."),
    invalidMetadataFontStyleProperty:               createErrorDiagnosticMessage("InvalidMetadataFontStyleProperty"             , 4005, "'{0}'是无效的字体样式属性."),
    invalidMetadataControlStyleProperty:            createErrorDiagnosticMessage("InvalidMetadataControlStyleProperty"          , 4006, "'{0}'是无效的控件样式属性."),
    invalidMetadataStyleProperty:                   createErrorDiagnosticMessage("InvalidMetadataStyleProperty"                 , 4007, "'{0}'是无效的样式属性."),
    duplicateSpecifiedLabel:                        createErrorDiagnosticMessage("DuplicateSpecifiedLabel"                      , 4008, "为'{0}'指定的标签重复, 以相同的语言、上下文和标签类型指定了标签'{1}'和'{2}'."),
    invalidUsageType:                               createErrorDiagnosticMessage("InvalidUsageType"                             , 4009, "'{0}'是无效的字段使用类型."),
    invalidMetadataFieldType:                       createErrorDiagnosticMessage("InvalidMetadataFieldType"                     , 4010, "'{0}'是无效的元数据类型."),
    invalidMetadataValueRange:                      createErrorDiagnosticMessage("InvalidMetadataValueRange"                    , 4011, "元数据数值区间语法错误."),
    propertyNameOccupied:                           createErrorDiagnosticMessage("TemplateNameOccupied"                         , 4012, "名称'{0}'已被占用."),
    illegalMetadataName:                            createErrorDiagnosticMessage("IllegalMetadataName"                          , 4013, "非法名称'{0}'."),
    invalidMetadataDBType:                          createErrorDiagnosticMessage("InvalidMetadataDBType"                        , 4014, "无效的数据库变量类型'{0}'."),
    invalidMetadataDBColumnProperty:                createErrorDiagnosticMessage("InvalidMetadataDBColumnProperty"              , 4015, "'{0}'是无效的数据库变量列属性."),
    lostNecessaryMetadataDbColumnProperty:          createErrorDiagnosticMessage("LostNecessaryMetadataDBColumnProperty"        , 4016, "缺少必要的数据库变量列属性'{0}'."),
    lostNecessaryMetadataDbProperty:                createErrorDiagnosticMessage("LostNecessaryMetadataDbProperty"              , 4017, "缺少必要的数据库变量属性'{0}'."),
    doNotFindMetadataPageItem:                      createErrorDiagnosticMessage("DoNotFindMetadataPageItem"                    , 4018, "未找到名为'{0}'的页面元素."),
    duplicateMetadataCategory:                      createErrorDiagnosticMessage("DuplicateMetadataCategory"                    , 4019, "名为'{0}'的分类元素已存在."),
    duplicateMetadataField:                         createErrorDiagnosticMessage("DuplicateMetadataField"                       , 4020, "名为'{0}'的元数据字段已存在."),
    doNotFindMetadataLCLAreaName:                   createErrorDiagnosticMessage("DoNotFindMetadataLCLAreaName"                 , 4021, "未找到名为'{0}'的存储区域定义."),
    redeclareMetadataLCLAreaName:                   createErrorDiagnosticMessage("RedeclareMetadataLCLAreaName"                 , 4022, "名为'{0}'的存储区域定义已存在."),
    fieldIsNotCompatibleWithExistField:             createErrorDiagnosticMessage("FieldIsNotCompatibleWitExistField"            , 4023, "名为'{0}'字段与已有同名字段的类型不兼容, 原始字段类型为'{1}'."),
    invalidMetadataLanguage:                        createErrorDiagnosticMessage("InvalidMetadataLanguage"                      , 4024, "'{0}'是无效的语言类型."),
    invalidMetadataUserContext:                     createErrorDiagnosticMessage("InvalideMetadataUserContext"                  , 4025, "'{0}'是无效的用户上下文类型."),
    invalidMetadataLabelType:                       createErrorDiagnosticMessage("InvalidMetadataLabelType"                     , 4026, "'{0}'是无效的标签类型."),
    invalidMetadataRoutingContext:                  createErrorDiagnosticMessage("InvalidMetadataRoutingContext"                , 4027, "'{0}'是无效的路由上下文类型."),
    unknownMetadataField:                           createErrorDiagnosticMessage("UnknownMetadataField"                         , 4028, "未知名为'{0}'的元数据字段."),
    unknownMetadataCategories:                      createErrorDiagnosticMessage("UnknownMetadataCategories"                    , 4029, "未知名为'{0}'的元数据分类列表."),

    // loader error
    unknownElementTag:                              createErrorDiagnosticMessage("UnknownElementTag"                            , 5001, "未知的XML元素标签'{0}'."),
    missingRootNode:                                createErrorDiagnosticMessage("MissingRootNode"                              , 5002, "文档缺少根节点'mdm'."),
    missingAtrribute:                               createErrorDiagnosticMessage("MissingAtrribute"                             , 5003, "XML元素'{0}'缺少属性'{1}'."),
    missingReferenceVariable:                       createErrorDiagnosticMessage("MissingReferenceVariable"                     , 5004, "没有找到ID为'{0}'的变量定义."),
    missingReferenceCategories:                     createErrorDiagnosticMessage("MissingReferenceCategories"                   , 5005, "没有找到ID为'{0}'的分类列表."),
    missingDatasource:                              createErrorDiagnosticMessage("MissingDatasource"                            , 5006, "未找到名为'{0}'的数据源."),
    missingLanguages:                               createErrorDiagnosticMessage("MissingLanguages"                             , 5007, "文档缺少语言配置."),
    unknownChildElementTag:                         createErrorDiagnosticMessage("UnknownChildElementTag"                       , 5008, "在节点'{0}'中节点'{1}'无效."),
    unknownAreaName:                                createErrorDiagnosticMessage("UnknownAreaName"                              , 5009, "未知名为'{0}'的区域名称."),
    findMultipleNamedReferenceVariable:             createErrorDiagnosticMessage("FindMultipleNamedReferenceVariable"           , 5010, "查询到多个名为'{0}'的字段."),
    missingNamedReferenceVariable:                  createErrorDiagnosticMessage("MissingNamedReferenceVariable"                , 5011, "未找到名为'{0}'的字段."),
    // serializer error
    variableNeedReference:                          createErrorDiagnosticMessage("VariableNeedReference"                        , 6001, "ID为'{0}'的变量缺少引用."),

};

export const warningMessages = {
    localVariableNameConflictWithMacro:       createWarningDiagnosticMessage("LocalVariableNameConflictWithMacro", 7001, "名为'{0}'的变量和已定义的宏名称冲突, 内容替换后可能是错误的."),

    // metadata
    invalidFormatOfUnitsOfLength:             createWarningDiagnosticMessage("InvalidFormatOfUnitsOfLength"        , 8001, "无效的长度值."),
    canNotFindCategoricalInField:             createWarningDiagnosticMessage("CanNotFindCategoricalInField"        , 8002, "在字段'{0}'中没有找到名为'{1}'的分类名."),
    fieldCategoriesIsNotFullyCoincident:      createWarningDiagnosticMessage("FieldCategoriesIsNotFullyCoincident" , 8003, "元数据字段'{0}'的分类值定义不能和'{1}'的分类值定义充分重合."),
    categoryIsNotDefinedInField:              createWarningDiagnosticMessage("CategoryIsNotDefinedInField"         , 8004, "分类值'{0}'在字段'{1}'中没有定义."),
    containsAllWillAlwaysReturnValue:         createWarningDiagnosticMessage("ContainsAllWillAlwaysReturnValue"    , 8005, "分类值'{0}'不在字段'{1}'中, 表达式将一直返回'{2}'."),
    duplicateCategoryValue:                   createWarningDiagnosticMessage("DuplicateCategoryValue"              , 8006, "分类值'{0}'重复.")

};
